#include int ReadBuffer ( char *Buffer, int Limit ) /*++ Routine Description: This routine fills a user supplied buffer with data from stdin. Arguments: Buffer - Supplies a pointer to the data buffer being filled Limit - Supplies the maximum size, in bytes, of the caller supplied buffer Return Value: int - Returns a count of the actual number of bytes read in --*/ { int c; int i; i = 0; while ((--Limit > 0) && ((c = getchar()) != EOF)) { Buffer[i++] = c; } return i; } void WriteBuffer ( char *Buffer, int Size ) /*++ Routine Description: This routine writes out a user supplied buffer to stdout Arguments: Buffer - Supplies a pointer to the data buffer being written Size - Specifies the number of bytes to write out Return Value: None. --*/ { int i; for (i = 0; i < Size; i += 1) { putchar(Buffer[i]); } return; }